<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
   Vue组件
    Vue.component
  -->
<div id="app">
   <!--引用定义的组件,循环数据-->
    <ziyi v-for="item in items" v-bind:zi="item"></ziyi>
</div>

<!--导入vue.js cdn-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>

    //自定义组件
    Vue.component("ziyi",{//模板名称
        props: ['zi'],//接收的参数名称
        template: " <li>{{zi}}</li>"//自定义模板
    })

   var vm = new Vue({
       el: "#app",
       data: {
            items:["Mybatis","Spring","SpringMvc","Vue"]
       }
   });
</script>
</body>
</html>